﻿using Common.FrontEnd;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Common
{
    /// <summary>
    /// Represents a single state in an HMM
    /// </summary>
    public interface IHMMState
    {
        /// <summary>
        /// Gets the HMM associated with this state
        /// </summary>
        /// <returns>the HMM</returns>
        IHMM getHMM();
        /// <summary>
        /// Returns the mixture components associated with this Gaussian
        /// </summary>
        /// <returns>the array of mixture components</returns>
        IMixtureComponent[] getMixtureComponents();
        /// <summary>
        /// Gets the id of the mixture
        /// </summary>
        /// <returns>the id</returns>
        long getMixtureId();

        /// <summary>
        /// 
        /// </summary>
        /// <returns>the mixture weights vector</returns>
        float[] getLogMixtureWeights();

        /// <summary>
        /// Gets the state
        /// </summary>
        /// <returns>the state</returns>
        int getState();

        /// <summary>
        /// Gets the score for this HMM state
        /// </summary>
        /// <param name="data">the data to be scored</param>
        /// <returns>the acoustic score for this state.</returns>
        float getScore(IData data);

        float[] calculateComponentScore(IData data);

        /// <summary>
        /// Determines if this HMMState is an emitting state
        /// </summary>
        /// <returns>true if the state is an emitting state</returns>
        Boolean isEmitting();

        /// <summary>
        /// Retrieves the state of successor states for this state
        /// </summary>
        /// <returns>the set of successor state arcs</returns>
        IHMMStateArc[] getSuccessors();

        /// <summary>
        /// Determines if this state is an exit state of the HMM
        /// </summary>
        /// <returns>true if the state is an exit state</returns>
        Boolean isExitState();

    }
}
